package com.itheima.listdemo;

import java.util.ArrayList;
import java.util.List;

public class ListDemo2 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("aaa");
        list.add("bbb");
        list.add("ccc");

//        addAtIndex(list);

//        removeAtIndex(list);

//        setAtIndex(list.set(0, "qqq"), list);

        String s = list.get(0);
        System.out.println(s);
    }

    private static void setAtIndex(String list, List<String> list1) {
        String result = list;
        System.out.println(result);
        System.out.println(list1);
    }

    private static void removeAtIndex(List<String> list) {
        String removeStr = list.remove(0);
        System.out.println(removeStr);
        System.out.println(list);
    }

    private static void addAtIndex(List<String> list) {
        list.add(0, "qqq");
        System.out.println(list);
    }
}
